package com.ross.web.util;

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class DateUtil {
	
	
	public static String getDateToday() {
		String datetoday;
		GregorianCalendar d = new GregorianCalendar(); 
		String  today  =   String.valueOf(d.get(Calendar.DAY_OF_MONTH ));
		String  month  =   String.valueOf(d.get(Calendar.MONTH) + 1);
		int  year   =  d.get(Calendar.YEAR); 
		int  hour   =  d.get(Calendar.HOUR_OF_DAY);
		int  minute =  d.get(Calendar.MINUTE);
		if( today.length() == 1 ) {
			today = "0" + today;
		}
		if( month.length() == 1 ) {
			month = "0" + month;
		}
		datetoday =  month + "/" + today  + "/" + year;
		System.out.println("datetoday= "+datetoday);
		return datetoday;
	}
	
	public static String getTimeToday() {
		SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss aa");
		Calendar cal = Calendar.getInstance();
		Date timeDate = cal.getTime();
		return sdf.format(timeDate);
	}
	
	public static int isDateFromDateToEqual(Date sDate, Date eDate){
		if(sDate.getTime() > eDate.getTime()){
			return 0;
		}else{
			return 1;
		}
	}

	
	
	
	
	
}
